package com.yanqu.road.server.manager.activity.springunionbanquet;

import java.util.ArrayList;
import java.util.List;

/**
 * 商会的宴请，方便遍历
 */
public class UnionBanquetUnion {

    //商会
    private String unionUid;

    //宴请信息
    private List<UnionBanquetOpenInfo> openInfoList = new ArrayList<>();

    //需要同步的玩家
    private List<Long> syncList = new ArrayList<>();

    private UnionBanquetUnion(){

    }

    public UnionBanquetUnion(String unionUid) {
        this.unionUid = unionUid;
    }

    public String getUnionUid() {
        return unionUid;
    }

    public List<UnionBanquetOpenInfo> getOpenInfoList() {
        return openInfoList;
    }

    public List<Long> getSyncList() {
        return syncList;
    }

    public List<Long> getNeedSyncList() {
        return new ArrayList<>(syncList);
    }

    public void setSyncList(List<Long> syncList) {
        this.syncList = syncList;
    }

    public UnionBanquetOpenInfo findById(long banquetId){
        for (int i = 0; i < openInfoList.size(); i++) {
            UnionBanquetOpenInfo openInfo = openInfoList.get(i);
            if(openInfo.getOpenData().getBanquetId() == banquetId){
                return openInfo;
            }
        }
        return null;
    }

}
